Skip to content

tidb-cloud: add TopRU user guide in TiDB Cloud Clinic (Premium)#22760

Open
zimulala wants to merge 3 commits into
pingcap:masterfrom
zimulala:codex/topru-cloud-premium-doc-master
Open

tidb-cloud: add TopRU user guide in TiDB Cloud Clinic (Premium)#22760
zimulala wants to merge 3 commits into
pingcap:masterfrom
zimulala:codex/topru-cloud-premium-doc-master

Conversation

@zimulala
Copy link
Copy Markdown
Contributor

What is changed, added or deleted? (Required)

This PR adds full TopRU user documentation for TiDB Cloud Clinic (Premium/Dedicated scope), instead of only adding a link.

Changes include:

  • Add a new doc page: tidb-cloud/premium/top-ru-in-clinic-premium.md
    • Feature overview and recommended scenarios
    • Prerequisites
    • Page views and usage workflow
    • Observation dimensions and granularity
    • Limitations and FAQ
  • Update navigation:
    • TOC-tidb-cloud-premium.md
    • tidb-cloud/premium/_index.md
  • Update tidb-cloud/tidb-cloud-clinic.md to include TopRU entry and section.
  • Add TopRU screenshots under media/tidb-cloud/.

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v8.5 (TiDB 8.5 versions)
  • v8.4 (TiDB 8.4 versions)
  • v8.3 (TiDB 8.3 versions)
  • v8.2 (TiDB 8.2 versions)
  • v8.1 (TiDB 8.1 versions)
  • v7.5 (TiDB 7.5 versions)
  • v7.1 (TiDB 7.1 versions)
  • v6.5 (TiDB 6.5 versions)
  • v6.1 (TiDB 6.1 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)

What is the related PR or file link(s)?

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign icemap for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 15, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces documentation for the TopRU feature in TiDB Cloud Clinic, including a new detailed guide and updates to the Table of Contents and main Clinic documentation. The feature allows users to identify high resource unit (RU) consumption by SQL statements and database users. The review feedback focuses on improving the documentation's clarity and adherence to the style guide by suggesting the use of active voice, removing redundant phrasing, and ensuring technical terms like TopN and sql_digest are properly formatted with backticks.

Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
Comment thread tidb-cloud/premium/top-ru-in-clinic-premium.md Outdated
@zimulala zimulala requested a review from XuHuaiyu April 27, 2026 08:59
@ti-chi-bot
Copy link
Copy Markdown

ti-chi-bot Bot commented Apr 27, 2026

@zimulala: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-verify ed6038a link true /test pull-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@@ -0,0 +1,124 @@
---
title: TopRU views in Top SQL in TiDB Cloud Clinic
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: TopRU views in Top SQL in TiDB Cloud Clinic
title: Top RU on TiDB Cloud Web Console for Premium&Essential

@@ -0,0 +1,124 @@
---
title: TopRU views in Top SQL in TiDB Cloud Clinic
summary: Learn how to use TopRU in TiDB Cloud Clinic to identify SQL statements and database users with high RU consumption.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: Learn how to use TopRU in TiDB Cloud Clinic to identify SQL statements and database users with high RU consumption.
summary: Learn how to use Top RU on TiDB Cloud Web Console to identify SQL statements and database users with high RU consumption.

summary: Learn how to use TopRU in TiDB Cloud Clinic to identify SQL statements and database users with high RU consumption.
---

# TopRU views in Top SQL in TiDB Cloud Clinic
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# TopRU views in Top SQL in TiDB Cloud Clinic
# Top RU on TiDB Cloud Web Console for Premium&Essential


# TopRU views in Top SQL in TiDB Cloud Clinic

TopRU is an SQL observability feature in the Top SQL page of TiDB Cloud Clinic. It ranks SQL workloads by request unit (RU) consumption to help you quickly identify SQL statements with high resource usage.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TopRU is an SQL observability feature in the Top SQL page of TiDB Cloud Clinic. It ranks SQL workloads by request unit (RU) consumption to help you quickly identify SQL statements with high resource usage.
Top RU is an SQL observability feature on TiDB Cloud Web Console. It ranks SQL workloads by request unit (RU) consumption to help you quickly identify SQL statements with high resource usage.


TopRU is an SQL observability feature in the Top SQL page of TiDB Cloud Clinic. It ranks SQL workloads by request unit (RU) consumption to help you quickly identify SQL statements with high resource usage.

TopRU reuses the Top SQL collection and reporting pipeline, but extends the core metric from CPU to RU, and aggregates records by `(user, sql_digest, plan_digest)`. This helps you identify both high-cost SQL statements and the database users who continuously consume RU.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TopRU reuses the Top SQL collection and reporting pipeline, but extends the core metric from CPU to RU, and aggregates records by `(user, sql_digest, plan_digest)`. This helps you identify both high-cost SQL statements and the database users who continuously consume RU.
Top RU reuses the Top SQL collection and reporting pipeline, but extends the core metric from CPU to RU, and aggregates records by `(user, sql_digest, plan_digest)`. This helps you identify both high-cost SQL statements and the database users who continuously consume RU.

- Is an RU spike in a time range caused by a small set of users or SQL statements?
- Why is resource consumption high even when CPU usage is not high?

TopRU data comes from runtime RU statistics in SQL execution, so it can reflect near-real-time resource trends. To control overhead, TopRU applies `TopN` aggregation to users and SQL statements, and merges low-priority items instead of outputting a full per-statement stream.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TopRU data comes from runtime RU statistics in SQL execution, so it can reflect near-real-time resource trends. To control overhead, TopRU applies `TopN` aggregation to users and SQL statements, and merges low-priority items instead of outputting a full per-statement stream.
Top RU data comes from runtime RU statistics in SQL execution, so it can reflect near-real-time resource trends. To control overhead, Top RU applies `TopN` aggregation to users and SQL statements, and merges low-priority items instead of outputting a full per-statement stream.


## Recommended scenarios

TopRU is useful in the following scenarios:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TopRU is useful in the following scenarios:
Top RU is useful in the following scenarios:

- You need user-level visibility to answer "who is consuming RU" instead of only "which SQL consumes CPU".
- You need to quickly identify major RU hotspots under high load and prioritize SQL optimization, resource group governance, or workload throttling.

TopRU is not for the following scenarios:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TopRU is not for the following scenarios:
Top RU is not for the following scenarios:

TopRU is not for the following scenarios:

- Billing, reconciliation, or precise auditing.
- Replacing slow query logs, `statements_summary`, or daily offline statistics from resource groups.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Replacing slow query logs, `statements_summary`, or daily offline statistics from resource groups.
- Replacing Slow Query, SQL Statement, or daily offline statistics from resource groups.


## Prerequisites

Before using TopRU, make sure that all of the following conditions are met:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Before using TopRU, make sure that all of the following conditions are met:
Before using Top RU, make sure that all of the following conditions are met:

Copy link
Copy Markdown

@huoyao1125 huoyao1125 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall Review

This PR has several critical issues that need to be addressed before merging:

  1. Wrong product surface: Top RU is a feature in the TiDB Cloud web console, not in TiDB Cloud Clinic. The entire doc is filed under tidb-cloud/premium/ (Clinic Premium), which is incorrect. It should be a standalone page in the main TiDB Cloud web console docs (e.g., tidb-cloud/top-ru.md).

  2. Essential tier completely missing: The product spec explicitly supports both Premium and Essential product tiers with different capabilities. This doc only covers Dedicated/Premium.

  3. Internal perspective instead of user perspective: Several sections describe internal implementation details (aggregation keys, pipeline reuse, TopN compression algorithm) that belong in engineering design docs, not user-facing documentation. Users need to know what they can do and why, not how it works internally.

  4. Key features missing from spec:

    • Rank by Users panel (added in V1.4, Jan 7 2026) - not documented at all
    • Top N configuration per tier: Premium default 10 (options: 20/50/100); Essential default 5 (options: 10/20)
    • Data retention per tier: Premium 30 days; Essential 7 days
    • Time range options: preset options + custom range with 24-hour max window constraint
    • Drill-down plan scenarios: 4 scenarios based on plan availability are not fully covered
    • Quick link from Query template ID to Slow Query logs
  5. Prerequisite "Resource Control enabled" is incorrect: Top RU is a product-level observability feature available on Premium/Essential clusters. Users do not need to manually enable Resource Control for Top RU to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-translation-status This PR does not have translation status info. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants